package VN.EDU.IMIC.DEVELOPER.TRINHCAOSANG.Exam01.Bai1.Bai1;

/**
 * Created by Sang on 07/03/2016.
 */
public class TrapezoidEntity implements IGeometricObject {
    private double dayLon;
    private double dayBe;
    private double canhBen1;
    private double canhBen2;
    private double high;

    public double getHigh() {
        return high;
    }

    public void setHigh(double high) {
        this.high = high;
    }

    public double getDayLon() {
        return dayLon;
    }

    public void setDayLon(double dayLon) {
        this.dayLon = dayLon;
    }

    public double getDayBe() {
        return dayBe;
    }

    public void setDayBe(double dayBe) {
        this.dayBe = dayBe;
    }

    public double getCanhBen1() {
        return canhBen1;
    }

    public void setCanhBen1(double canhBen1) {
        this.canhBen1 = canhBen1;
    }

    public double getCanhBen2() {
        return canhBen2;
    }

    public void setCanhBen2(double canhBen2) {
        this.canhBen2 = canhBen2;
    }

    @Override
    public double getArea(Object object) {
        return ((dayBe + dayLon) / 2) * high;
    }

    @Override
    public double getPerimeter(Object object) {
        return dayBe + dayLon + canhBen1 + canhBen2;
    }
}
